Skip to content

fix(search): drop the stray log and the sort that always gave NaN - #567

Merged
YOGESH-08 merged 1 commit into
CodeChefVIT:stagingfrom
Dx-Alz-xD:krish/search-cleanup
Nov 15, 2026
Merged

YOGESH-08 merged 1 commit into
CodeChefVIT:stagingfrom
Dx-Alz-xD:krish/search-cleanup

Conversation

@Dx-Alz-xD

Copy link
Copy Markdown
Contributor

📌 Purpose

The home search bar logged the whole subject list to the console on every load. Both search bars also sorted results with (a.score ?? Infinity) - (b.score ?? Infinity), but Fuse was set up without includeScore, so every comparison was Infinity - Infinity = NaN.


Corresponding issue: closes #547


🖼️ Showcase

No visible change. Fuse already returns results best match first, so the order users see is the same.


🔧 Changes

  • Removed console.log(initialSubjects) from searchbar-child.tsx
  • Removed the NaN sort from searchbar-child.tsx and pinned-searchbar.tsx

➕ Additional Notes

  • I checked that Fuse's default order matches a real score sort for the same query

the search bar logged the whole subject list on every load, and both
search bars sorted results by score although fuse was set up without
includeScore, so every comparison was Infinity - Infinity. fuse already
returns the best matches first, so the sort goes
@YOGESH-08

Copy link
Copy Markdown
Collaborator

Thanks for cleaning this up

@YOGESH-08
YOGESH-08 merged commit 6dcbc14 into CodeChefVIT:staging Nov 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search Bar NaN Sorting & Console Log Spam

2 participants